<template>
  <ul class="contact-container">
    <!-- github -->
    <li>
      <a target="_blank" :href="data.github">
        <div class="icon">
          <!-- <Icon type="icongithub" /> -->
          <Icon type="github" />
        </div>
        <span>{{ data.githubName }}</span>
      </a>
      <!-- 弹出窗口 -->
    </li>
    <!-- 邮箱 -->
    <li>
      <a :href="`mailto:${data.mail}`">
        <div class="icon">
          <Icon type="mail" />
        </div>
        <span>{{ data.mail }}</span>
      </a>
      <!-- 弹出窗口 -->
    </li>
    <!-- qq -->
    <li>
      <a
        :href="`tencent://message/?Menu=yes&uin=${data.qq}&Service=300&sigT=45a1e5847943b64c6ff3990f8a9e644d2b31356cb0b4ac6b24663a3c8dd0f8aa12a595b1714f9d45`"
      >
        <div class="icon">
          <Icon type="qq" />
        </div>
        <span>{{ data.qq }}</span>
      </a>

      <!-- 弹出窗口 -->
      <div class="pop">
        <img :src="data.qqQrCode" alt="" />
      </div>
    </li>
    <!-- 微信 -->
    <li>
      <a>
        <div class="icon weixin">
          <Icon type="weixin" />
        </div>
        <span>{{ data.weixin }}</span>
      </a>
      <!-- 弹出窗口 -->
      <div class="pop">
        <img :src="data.weixinQrCode" />
      </div>
    </li>
  </ul>
</template>

<script>
import Icon from "@/components/Icon";
import { mapState } from "vuex";
import "@/styles/global.less";
import "@/styles/var.less";
export default {
  components: {
    Icon,
  },
  computed: mapState("setting", ["data"]),
};
</script>

<style scoped lang="less">
@import "~@/styles/var.less";
.contact-container {
  color: @lightWords;
  padding: 20px;
  margin: 0;
  li {
    height: 30px;
    line-height: 30px;
    margin: 30px 0;
    position: relative;
    &:hover {
      .pop {
        transform: scaleY(1);
        transform: scaleX(1);
        //还原图片的y轴
      }
      .icon {
        color: gray;
      }
    }
  }
  a {
    display: flex;
    //设置为弹性盒子
    align-items: center;
    cursor: pointer;
    &:hover {
      color: gray;
    }
  }
  .icon {
    color: @lightWords;
    font-size: 26px;
    width: 36px;
    &.weixin {
      font-size: 32px;
      text-indent: -3px;
    }
  }
}
.pop {
  position: absolute;
  left: 0;
  bottom: 33px;
  width: 110px;
  height: 110px;
  background-color: #fff;
  padding: 10px 15px;
  display: flex;
  justify-content: center;
  //水平居中
  align-items: center;
  //垂直居中
  transform: scaleY(0);
  // 将图标y轴进行缩小
  transform: scaleX(0);
  transform-origin: bottom center;
  //设置放大中心点 最下面 最中间
  transition: 0.5s;
  img {
    width: 100px;
    height: 100px;
    display: block;
    margin: 0 auto;
  }
  &::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    background-color: #fff;
    width: 8px;
    height: 8px;
  }
}
</style>